package com.lzy.springcloud.controller;

import com.lzy.springcloud.entity.CommonResult;
import com.lzy.springcloud.entity.Payment;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.*;

import java.util.UUID;

@RestController
@RequestMapping("/api")
@Slf4j
public class PaymentController {

    @Value("${server.port}")
    private String serverPort;
    @Autowired
    private DiscoveryClient discoveryClient;

    @PostMapping(value = "/payment/create")
    public CommonResult create() {

        return new CommonResult(200, "插入数据库成功,port:" + serverPort + "\t" + UUID.randomUUID());

    }

    @GetMapping(value = "/payment/get")
    public CommonResult<Payment> getPaymentById() {
        return new CommonResult(200, "查询成功,port:" + serverPort + "\t" + UUID.randomUUID());
    }


}


